export const buildDictTree = (data) => {
	const map = {};
	const tree = [];
	data.forEach((item) => {
		map[item.id] = { label: item.name, value: item.id, parent: item.parent == null ? "" : item.parent.id, children: [], childrenData: item.children, version: item.version };
	});
	data.forEach((item) => {
		if (item.parent == null) {
			tree.push(map[item.id]);
		} else {
			if (map[item.parent.id]) {
				map[item.parent.id].children.push(map[item.id]);
			}
		}
	});
	return tree;
};
